package com.thinkingstar.iads.datacenter.entity.dao;

import java.util.List;

import org.apache.commons.lang3.StringUtils;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.QueryResult;
import org.nutz.dao.pager.Pager;
import org.nutz.dao.sql.Criteria;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.util.NutMap;

import com.thinkingstar.iads.common.jsonUtils.AjaxResult;
import com.thinkingstar.iads.common.serviceImpl.EntityRepositoryServiceImpl;
import com.thinkingstar.iads.common.utils.CommonDateUtil;
import com.thinkingstar.iads.datacenter.entity.DcProjectPutFord;
import com.thinkingstar.iads.datacenter.entity.DcRescueEquipment;
/**
 * @ClassName: DaoDcProjectPutFord 
 * @Description:数据中心_项目_救援设备库
 * @author 1157372219@qq.com 
 * @date 2018年3月19日   
 */
@IocBean(args = {"refer:dao"})
public class DaoDcRescueEquipment extends EntityRepositoryServiceImpl<DcRescueEquipment>{

	public DaoDcRescueEquipment(Dao dao) {
		super(dao);
	}
	
	//查询救援设备库
	public QueryResult findDcRescueEquipmentList(NutMap param){
		List <DcRescueEquipment> list = null;
		Pager pager = null;
		Criteria criteria = Cnd.NEW();
		criteria.where().and("del_flag", "=", false);
		if(param.get("city") != null){
			criteria.where().and("city", "like", "%"+param.get("city")+"%");
		}
		if(param.get("page_num") != null && param.get("page_size") != null){
			pager = new Pager(param.getInt("page_num"), param.getInt("page_size"));
			pager.setRecordCount(count(criteria));
			list = query(criteria, pager);
		}else{
			list = query(criteria);
		}
		return new QueryResult(list, pager);
	}
	

}
